#include<algorithm>
#include<string>
using namespace std;
class Solution {
public:
    string reverseStr(string s, int k) {
        for (int begin = 0; begin < s.size(); begin += 2 * k)
        {
            int end = min(begin + k, (int)s.size());
            reverse(s.begin() + begin, s.begin() + end);
        }
        return s;
    }
};